/*
 * =====================================================================================
 *
 *       Filename:  tools.c
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  2025/03/17 00时10分32秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  zhuzonghui(puchuchen@outlook.com) (),
 *   Organization:
 *
 * =====================================================================================
 */
#include <fuquOS/tools.h>
#include <fuquOS/timer.h>
#include <fuquOS/printk.h>
#include <fuquOS/memory.h>
#include <fuquOS/cpu.h>

void print_current_time()
{
	Time *time = get_beijing_time();
	printk("current time is %d-%d-%d %d:%d:%d\n", time->year, time->month, time->day, time->hour, time->min, time->sec);
	kfree(time);
}

void print_cpu_info()
{
	cpu_info_t *info = get_cpu_info();
	printk("CPU vendor: %s\n", info->vendor);
	printk("CPU model: %s\n", info->model);
	printk("CPU frequency: %d MHz\n", info->frequency);

	printk("CPU features: \n");
	for (u8 i = 0; i < info->feature_count; i++)
	{
		printk("	%x\n", info->features[i]);
	}
	printk("CPU total threads: %d\n", info->thread_count);
	printk("CPU total cores: %d\n", info->core_count);
}